#include <stdio.h>
#include <stdint.h>
#include "air105.h"
#include "sysc.h"
#include "delay.h"
#include "usart.h"



int main(void)
{
	SystemClock_Config_HSE();
	Delay_Init();
	USART_Init();
    
    GPIO_InitTypeDef gpio;
    gpio.GPIO_Pin = GPIO_Pin_14;
    gpio.GPIO_Mode = GPIO_Mode_Out_PP;
    gpio.GPIO_Remap = GPIO_Remap_1;
    GPIO_Init(GPIOD, &gpio);
    gpio.GPIO_Pin = GPIO_Pin_15;
    GPIO_Init(GPIOD, &gpio);

	printf("USART_Init\r\n");
	printf("I2C Init\r\n");

	while (1)
	{
        GPIO_ResetBits(GPIOD, GPIO_Pin_14);
        GPIO_ResetBits(GPIOD, GPIO_Pin_15);
        printf("ON\r\n");
        Delay_ms(1000);
        GPIO_SetBits(GPIOD, GPIO_Pin_14);
        GPIO_SetBits(GPIOD, GPIO_Pin_15);
        printf("OFF\r\n");
		Delay_ms(1000);
	}
}

#ifdef  USE_FULL_ASSERT

/**
  * @brief  Reports the name of the source file and the source line number
  *         where the assert_param error has occurred.
  * @param  file: pointer to the source file name
  * @param  line: assert_param error line source number
  * @retval None
  */
void assert_failed(uint8_t* file, uint32_t line)
{
	/* User can add his own implementation to report the file name and line number,
	 ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */

	 /* Infinite loop */
	while (1)
	{
	}
}
#endif
